GBML manual / 3D

view3d_camera

Puts the camera at (x, y) in the room, facing angle degrees (0 looks right, 90 looks up the room, counter-clockwise).

Game Boy: not available

Game Boy Color: not available

On other consoles this differs: see Side by side and How the consoles differ.

Syntax

view3d_camera(x, y, angle)

Arguments

NameType
xreal
yreal
anglereal

Returns

Nothing.

Description

Puts the camera at (x, y) in the room and turns it to face angle degrees.

x and y are room pixels counted from the room's top-left corner, a tile being 8 by 8 pixels, so the middle of the tile in column 3, row 5 is (28, 44). The angle is in degrees, counter-clockwise like every angle in this manual: 0 looks right, 90 looks up the room (toward y = 0), 180 looks left, 270 looks down.

It does not check for walls: put the camera in an open tile, or it sees the inside of a wall. To walk with collision, use view3d_move.

Example

view3d_start(ts_doc_walls);
// the middle of column 3, row 5, looking up the room
view3d_camera(28, 44, 90);

The camera starts in an open tile, looking toward the top of the room.

On the GBA

x and y are room pixels counted from the room’s top-left corner, a tile being 8 by 8. It does not check for walls: put the camera in an open tile, or it will see the inside of a wall. Use view3d_move to walk with collision.

See also: 3D viewview3d_moveview3d_turnview3d_xview3d_angle